// pages/home/home.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    isShow:true,
    ishide:true,
    content:[
      {src:"/images/校园周边/北区学生公寓对面楠火锅.png",name:"楠火锅"},
      {src:"/images/校园周边/北区学生公寓苗菇凉羊肉粉.png",name:"苗菇凉羊肉粉"},
      {src:"/images/校园周边/北区新竹路天天羊肉粉.png",name:"天天羊肉粉"},
      {src:"/images/校园周边/北区门口酱香饼.png",name:"酱香饼"},
      {src:"/images/校园周边/北区门口襄阳牛肉面.png",name:"襄阳牛肉面"},
      {src:"/images/校园周边/北区门口鸡腿薯条.png",name:"鸡腿薯条"},
      {src:"/images/校园周边/南二门烤肉饭.png",name:"烤肉饭"},
      {src:"/images/校园周边/南二门曹记炒饭.png",name:"曹记炒饭"},
      {src:"/images/校园周边/南二门铁板炒饭.png",name:"铁板炒饭"},
      {src:"/images/校园周边/财大小吃街遵义火锅店.png",name:"遵义火锅店"},
      {src:"/images/校园周边/财大小吃街土豆泥拌饭.png",name:"土豆泥拌饭"},
      {src:"/images/校园周边/财大小吃街辽宁鸡架.png",name:"辽宁鸡架"},
      {src:"/images/校园周边/财大小吃街柳州仔螺狮粉.png",name:"柳州仔螺狮粉"},
      {src:"/images/校园周边/北区门口正新鸡排.png",name:"正新鸡排"},
    ],
    milkTeaContent:[
      {src:"/images/奶茶/乐研茶.jpg",name:"乐研茶",link:"#小程序://乐研茶/dLHNADuI5FVj1VH"},
      {src:"/images/奶茶/古茗.jpg",name:"古茗",link:"#小程序://古茗茶饮点单/2PJC4m0WgNlk1df"},
      {src:"/images/奶茶/幸运咖.jpg",name:"幸运咖",link:"#小程序://幸运咖/TtBI8GClzHiYTmp"},
      {src:"/images/奶茶/瑞幸.jpg",name:"瑞幸",link:"#小程序://瑞幸咖啡/OjFGCkIhUN3XWEr"},
      {src:"/images/奶茶/真茶屋.jpg",name:"真茶屋",link:"#小程序://真茶屋/S3wA6gmlbP2cAqa"},
      {src:"/images/奶茶/茶百道.jpg",name:"茶百道",link:"#小程序://茶百道点餐+/d9WSAdxm9Gd03Wv"},
      {src:"/images/奶茶/茶颜悦色.jpg",name:"茶颜悦色",link:"#小程序://茶颜悦色/Epdce2IZZePREhd"},
      {src:"/images/奶茶/蜜雪冰城.jpg",name:"蜜雪冰城",link:"#小程序://蜜雪冰城/AqsGqodU0yjSGTk"},
    ],
    food:'',
    drink:''
  },
  food:function(){
    // console.log(this.data.content.length);
     let index=Math.floor(Math.random() * this.data.content.length)
     this.setData({
       food:this.data.content[index].name
     })
  },
  drink:function(){
     let index=Math.floor(Math.random() * this.data.milkTeaContent.length)
     this.setData({
       drink:this.data.milkTeaContent[index].name
     })
  },
  milk:function(e){
    let index = e.currentTarget.dataset.index;  
    let link = this.data.milkTeaContent[index].link;  
    console.log(link);
    wx.navigateToMiniProgram({
      shortLink:link
    })
  },
  show:function () {
    this.setData({  
      ishide: !this.data.ishide,  
      isShow: !this.data.isShow  
    });  
  },
one:function () {
  wx.navigateTo({
    url: '/list1/pages/one/one',
  })
},
two:function () {
  wx.navigateTo({
    url: '/list1/pages/one/one',
  })
},
three:function () {
  wx.navigateTo({
    url: '/list1/pages/three/three',
  })
},
four:function () {
  wx.navigateTo({
    url: '/list1/pages/four/four',
  })
},
center:function () {
  wx.navigateTo({
    url: '/list2/pages/center/center',
  })
},
south:function () {
  wx.navigateTo({
    url: '/list2/pages/south/south',
  })
},
north:function () {
  wx.navigateTo({
    url: '/list2/pages/north/north',
  })
},
snack:function () {
  wx.navigateTo({
    url: '/list2/pages/snack/snack',
  })
},
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})